<?php

namespace App\Models\Ncdh;

use Illuminate\Database\Eloquent\Model;

class NcdhBettingSort extends Model
{
    protected $table = "game_ncdh_betting_sort";

    /*
     * 获取投注种类
     */
    public static function getSort()
    {

        $sort = self::get()->toArray();

        return $sort;
    }

    /*
     * 获取某一级的投注种类
     */
    public static function getSortByLevel($level)
    {

        $result = self::where('level', $level)->get()->toArray();

        return $result;
    }

    /*
     * 获取投注种类的父级
     */
    public static function getParentSort($id)
    {

        $sort = self::find($id);
        $sortPid = $sort->parent_id;

        return $sortPid;

    }

}
